package com.example.controller;

/**
 * @description：
 * @author：JBL
 * @date：2018/1/12
 */

import com.example.apiversion.ApiVersion;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

/**
 * @description：
 * @author：JBL
 * @date：2018/1/11
 */
@Controller
@RequestMapping("/{version}/")
public class Apicontroller {

    @RequestMapping("hello/")
    @ApiVersion(1)
    @ResponseBody
    public String hello(HttpServletRequest request){
        System.out.println("haha1..........");

        return "hello";
    }

    @RequestMapping("hello/")
    @ApiVersion(2)
    @ResponseBody
    public String hello2(HttpServletRequest request){
        System.out.println("haha2.........");

        return "hello";
    }

    @RequestMapping("hello/")
    @ApiVersion(5)
    @ResponseBody
    public String hello5(HttpServletRequest request){
        System.out.println("haha5.........");

        return "hello";
    }
}